package com.cn.lyl.dao.impl;

import com.cn.lyl.dao.ServiceTypeDependenceDao;
import com.cn.lyl.model.ServiceTypeDependenceModel;
import com.cn.lyl.util.JDBC;

import java.util.List;

public class ServiceTypeDependenceDaoImpl implements ServiceTypeDependenceDao {
    @Override
    public int add(ServiceTypeDependenceModel serviceTypeDependenceModel) {
        String sql ="INSERT INTO service_type_dependence (service_id,service_type_id,create_time, update_time, enable, remark)" +
                "VALUES ("+serviceTypeDependenceModel.getServiceId()+","+serviceTypeDependenceModel.getTypeId()+",now(),now(),1,'')";
        System.out.println(sql);
        return JDBC.update(sql);
    }

    @Override
    public int update(ServiceTypeDependenceModel ServiceTypeDependenceModel) {
        return 0;
    }

    @Override
    public int delete(ServiceTypeDependenceModel serviceTypeDependenceModel){
    String sql ="delete from service_type_dependence where news_id ="+serviceTypeDependenceModel.getServiceId();
        return JDBC.update(sql);
    }

    @Override
    public ServiceTypeDependenceModel findById(int id) {
        return null;
    }

    @Override
    public List<ServiceTypeDependenceModel> findAll(ServiceTypeDependenceModel serviceTypeDependenceModel) {
        return null;
    }
}
